//
//  THButton.m
//  Teacher-Help
//
//  Created by Taro on 15/10/25.
//  Copyright © 2015年 Taro. All rights reserved.
//

#import "THButton.h"
#import <Masonry/Masonry.h>

@implementation THButton

//- (void)setSelected:(BOOL)selected{
//    [super setSelected:selected ];
//    
//    UIImageView *btnimage = [[UIImageView alloc] init];
//    btnimage.image = [UIImage imageNamed:@"button"];
//    [self insertSubview:btnimage belowSubview:self.titleLabel];
//    [btnimage mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.center.equalTo(self);
//        make.size.mas_equalTo(CGSizeMake(25, 25));
//    }];
//    
//    if (selected) {
//        btnimage.hidden = NO;
//    }else{
//        btnimage.hidden = YES;
//    }
//}
//- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state{
//    UIImageView *btnimage = [[UIImageView alloc] init];
//    btnimage.image = [UIImage imageNamed:@"button"];
//    [self insertSubview:btnimage belowSubview:self.titleLabel];
//    [btnimage mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.center.equalTo(self);
//        make.size.mas_equalTo(CGSizeMake(25, 25));
//    }];
//    
//}
- (void)setButtonBg:(UIImage *)image{
    UIImageView *btnimage = [[UIImageView alloc] init];
    btnimage.image = image;
    [self insertSubview:btnimage belowSubview:self.titleLabel];
    [btnimage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
        make.size.mas_equalTo(CGSizeMake(25, 25));
    }];
    
    
}


@end
